import Cookies from 'js-cookie'

const refreshTokenKey = 'mall_refresh_token'
const accessTokenKey = 'mall_access_token'

export function getRefreshToken() {
  // return Cookies.get(refreshTokenKey)
  return localStorage.getItem(refreshTokenKey)
}
export function getAccessToken() {
  // return Cookies.get(accessTokenKey)
  return localStorage.getItem(accessTokenKey)
}

export function setToken(accessToken, refreshToken) {
  // Cookies.set(accessTokenKey, accessToken)
  // return Cookies.set(refreshTokenKey, refreshToken)
  localStorage.setItem(accessTokenKey, accessToken)
  return localStorage.setItem(refreshTokenKey, refreshToken)
}

export function removeToken() {
  // Cookies.remove(refreshTokenKey)
  // return Cookies.remove(accessTokenKey)
  localStorage.removeItem(refreshTokenKey)
  return localStorage.removeItem(accessTokenKey)
}
